<template>
  <div class="hello">
    <div>{{ msg }}</div>
  </div>
</template>

<script lang="ts" setup>
//因为这里用了script的setup方式就用不到 defineComponent 这个定义组件的api了
import { useSlots, useAttrs, defineProps, onMounted } from 'vue';
// 跳路由用
import router from '@/router/index';
// 获取路由参数
import { useRoute } from 'vue-router';
// const route = useRoute();
// const slots = useSlots();
// const attrs = useAttrs();

//获取子组件传的值
const props = defineProps({
  msg: String,
});

onMounted(() => {
  console.log('onMounted:', props);
});
</script>

<style scoped lang="scss"></style>
